home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / shelfStyle.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.2 KB  |  136 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Sept 1997
  22. //  Author:         cdg
  23. //
  24. //  Description:
  25. //      Set the shelf style for one shelf tab
  26. //
  27.  
  28. global proc shelfStyle(string $style, string $size, string $shelfLayout)
  29. {
  30.     int $width;
  31.     int $height;
  32.     int $h;
  33.     int $curSize;
  34.     int $boxWidth;
  35.     int $temp;
  36.     string $curStyle;
  37.  
  38.     if ($style == "nochange")
  39.         $style = `optionVar -q shelfItemStyle`;
  40.  
  41.     if ($size == "nochange") 
  42.         $size = `optionVar -q shelfItemSize`;
  43.  
  44.     if ($size == "small")
  45.         $size = "Small";
  46.     else if ($size == "medium")
  47.         $size = "Medium";
  48.     else if ($size == "large")
  49.         $size = "Large";
  50.     else if ($size == "Large" || $size == "Medium" || $size == "Small") {
  51.         //  okay
  52.     } else {
  53.         //  received bad data
  54.         $size = "Small";
  55.     }
  56.     
  57.     if ($style == "textOnly") {
  58.         $width = 80;
  59.         $height = 20;
  60.         $h = 26;
  61.         $boxWidth = 500;
  62.     } else if ($style == "iconAndTextHorizontal") {
  63.         if ($size == "Small") {
  64.             $width = 114;
  65.             $height = 34;
  66.             $h = 40;
  67.             $boxWidth = 504;
  68.         } else if ($size == "Medium") {
  69.             $width = 128;
  70.             $height = 48;
  71.             $h = 54;
  72.             $boxWidth = 505;
  73.         } else if ($size == "Large") {
  74.             $width = 144;
  75.             $height = 64;
  76.             $h = 70;
  77.             $boxWidth = 506;
  78.         }
  79.     } else if ($style == "iconAndTextVertical") {
  80.         if ($size == "Small") {
  81.             $width = 82;
  82.             $height = 54;
  83.             $h = 60;
  84.             $boxWidth = 507;
  85.         } else if ($size == "Medium") {
  86.             $width = 80;
  87.             $height = 68;
  88.             $h = 74;
  89.             $boxWidth = 508;
  90.         } else if ($size == "Large") {
  91.             $width = 80;
  92.             $height = 84;
  93.             $h = 90;
  94.             $boxWidth = 509;
  95.         }
  96.     } else if ($style == "iconOnly") {    
  97.         if ($size == "Small") {
  98.             $width = 34;
  99.             $height = 34;
  100.             $h = 40;
  101.             $boxWidth = 501;
  102.         } else if ($size == "Medium") {
  103.             $width = 48;
  104.             $height = 48;
  105.             $h = 54;
  106.             $boxWidth = 502;
  107.         } else if ($size == "Large") {
  108.             $width = 64;
  109.             $height = 64;
  110.             $h = 70;
  111.             $boxWidth = 503;
  112.         }
  113.     } else {
  114.         // bad data
  115.         $style = "iconOnly";
  116.         if ($size == "Small") {
  117.             $width = 34;
  118.             $height = 34;
  119.             $h = 40;
  120.             $boxWidth = 501;
  121.         } else if ($size == "Medium") {
  122.             $width = 48;
  123.             $height = 48;
  124.             $h = 54;
  125.             $boxWidth = 502;
  126.         } else if ($size == "Large") {
  127.             $width = 64;
  128.             $height = 64;
  129.             $h = 70;
  130.             $boxWidth = 503;
  131.         }
  132.     }
  133.  
  134.     shelfLayout -e -st $style -cwh $width $height -h $h $shelfLayout;
  135. }
  136.